package com.cq.hd.order.po;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 订单项表
 * </p>
 *
 * @author mYunYu
 * @since 2023-12-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_order_item")
@ApiModel(value = "TbOrderItemPo对象", description = "订单项表")
public class TbOrderItemPo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "商家id")
    @TableField("business_id")
    private Long businessId;

    @ApiModelProperty(value = "活动id")
    @TableField("active_id")
    private Long activeId;

    @ApiModelProperty(value = "经纪人id")
    @TableField("agent_id")
    private Long agentId;

    @ApiModelProperty(value = "二级经纪人id")
    @TableField("agent2_id")
    private Long agent2Id;

    @ApiModelProperty(value = "订单id")
    @TableField("order_id")
    private Long orderId;

    @ApiModelProperty(value = "下单用户id")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty(value = "活动商品id")
    @TableField("active_goods_id")
    private Long activeGoodsId;

    @ApiModelProperty(value = "子订单号")
    @TableField("sub_order_no")
    private String subOrderNo;

    @ApiModelProperty(value = "订单类型(1-团购订单,2-报名订单,4-团购+报名订单,5积分订单)")
    @TableField("order_type")
    private Integer orderType;

    @ApiModelProperty(value = "如果是多商户通用券，则为0，当核销成功之后，更新对应核销的商户id")
    @TableField("merchant_id")
    private Long merchantId;

    @ApiModelProperty(value = "商品id/商户id(如果是多商户通用券，则会存在多个，使用英文逗号分割")
    @TableField("goods_id")
    private String goodsId;

    @ApiModelProperty(value = "是否是多商户通用券(1-否，2-是)")
    @TableField("mul_state")
    private Integer mulState;

    @ApiModelProperty(value = "商品名称")
    @TableField("goods_name")
    private String goodsName;

    @ApiModelProperty(value = "商品图片")
    @TableField("goods_imgs")
    private String goodsImgs;

    @ApiModelProperty(value = "商户商品价格")
    @TableField("goods_price")
    private BigDecimal goodsPrice;

    @ApiModelProperty(value = "商品数量")
    @TableField("goods_num")
    private Integer goodsNum;

    @ApiModelProperty(value = "核销码")
    @TableField("verify_code")
    private String verifyCode;

    @ApiModelProperty(value = "商户订单本金(按比例分配的用户支付的订单款)")
    @TableField("merchant_amt")
    private BigDecimal merchantAmt;

    @ApiModelProperty(value = "商户订单补贴(该订单商场补贴的金额)")
    @TableField("merchant_subsidy_amt")
    private BigDecimal merchantSubsidyAmt;

    @ApiModelProperty(value = "佣金补贴金额(一级经纪人)")
    @TableField("commission_amt")
    private BigDecimal commissionAmt;

    @ApiModelProperty(value = "佣金补贴金额(二级经纪人)")
    @TableField("sub_agent_commission_amt")
    private BigDecimal subAgentCommissionAmt;

    @ApiModelProperty(value = "红包补贴金额")
    @TableField("red_packet_amt")
    private BigDecimal redPacketAmt;

    @ApiModelProperty(value = "总补贴金额")
    @TableField("total_subsidy_amt")
    private BigDecimal totalSubsidyAmt;

    @ApiModelProperty(value = "分销订单金额")
    @TableField("distribution_order_amt")
    private BigDecimal distributionOrderAmt;

    @ApiModelProperty(value = "可返还金额(核销后显示)")
    @TableField("return_amt")
    private BigDecimal returnAmt;

    @ApiModelProperty(value = "应返还金额")
    private BigDecimal estimatedReturnAmt;

    @ApiModelProperty(value = "订单状态(0-待支付，1-待核销，2-已核销，3-已取消，4-已过期)")
    @TableField("sub_order_state")
    private Integer subOrderState;

    @ApiModelProperty(value = "结算状态(1-未结算,2-已结算)作废")
    @TableField("settle_state")
    private Integer settleState;

    @ApiModelProperty(value = "下单时间")
    @TableField("order_time")
    private LocalDateTime orderTime;

    @ApiModelProperty(value = "订单核销时间")
    @TableField("verify_time")
    private LocalDateTime verifyTime;

    @ApiModelProperty(value = "订单取消时间")
    @TableField("cancel_time")
    private LocalDateTime cancelTime;

    @ApiModelProperty(value = "订单过期时间")
    @TableField("expire_time")
    private LocalDateTime expireTime;

    @ApiModelProperty(value = "订单结算时间")
    @TableField("settle_time")
    private LocalDateTime settleTime;

    @ApiModelProperty(value = "订单备注")
    @TableField("order_note")
    private String orderNote;

    @ApiModelProperty(value = "报名信息(json)")
    @TableField("enroll_info")
    private String enrollInfo;

    @ApiModelProperty(value = "创建者")
    @TableField("create_by")
    private Integer createBy;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新者")
    @TableField("update_by")
    private Integer updateBy;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;

    @ApiModelProperty(value = "删除状态:0-正常，1-已删除")
    @TableField("del_state")
    private Integer delState;

    @ApiModelProperty(value = "核销方式（只对报名活动有效）：0-系统，1-票付通")
    @TableField("verify_type")
    private Integer verifyType;

    @ApiModelProperty(value = "票付通产品ID")
    @TableField("pft_product")
    private String pftProduct;

    @ApiModelProperty(value = "票付通门票ID")
    @TableField("pft_ticket")
    private String pftTicket;

    @ApiModelProperty(value = "票付通供应商ID")
    @TableField("pft_supplier")
    private String pftSupplier;

    @ApiModelProperty(value = "票付通订单号")
    @TableField("pft_order")
    private String pftOrder;

    @ApiModelProperty(value = "是否是零元购活动（1-不是，2-是）")
    @TableField("zero_state")
    private Integer zeroState;

    @ApiModelProperty(value = "下单用户可得积分")
    @TableField("user_points_amt")
    private BigDecimal userPointsAmt;

    @ApiModelProperty(value = "一级经纪人可得积分")
    @TableField("agent_points_amt")
    private BigDecimal agentPointsAmt;

    @ApiModelProperty(value = "二级经纪人可得积分")
    @TableField("sub_agent_points_amt")
    private BigDecimal subAgentPointsAmt;

    @ApiModelProperty(value = "积分结算状态：0无需结算 1待结算 2已结算")
    @TableField("points_settle_state")
    private Integer pointsSettleState;

    @ApiModelProperty(value = "子单类型：1-商品 2-签到码")
    @TableField("item_type")
    private Integer itemType;

    @ApiModelProperty(value = "佣金结算状态：1待结算 2已结算")
    private Integer commissionSettleState;

    @ApiModelProperty(value = "子单分组")
    private Integer itemGroup;

}
